package demo5;
abstract class F {
    public abstract void fun();
}
class Money implements Cloneable{
    public int m = 100;

    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }
}
class Student implements Cloneable{
    public String name;
    public Money money = new Money();
    @Override
    protected Object clone() throws CloneNotSupportedException {
        Student student = (Student) super.clone();
        student.money = (Money) this.money.clone();
        return student;
        //return super.clone();

    }
}
public class Test {
    public static void main(String[] args) throws CloneNotSupportedException{
        Student student = new Student();
        student.name = "张三";
        Student student1 = (Student)student.clone();
        student1.name = "asdf";
        System.out.println(student1.name);
        System.out.println(student.name);
    }
}
